package com.ruoyi.cderp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cderp.mapper.SysDeptCderpMapper;
import com.ruoyi.cderp.domain.SysDeptCderp;
import com.ruoyi.cderp.service.ISysDeptCderpService;

/**
 * 部门Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-13
 */
@Service
public class SysDeptCderpServiceImpl implements ISysDeptCderpService 
{
    @Autowired
    private SysDeptCderpMapper sysDeptCderpMapper;

    /**
     * 查询部门
     * 
     * @param deptId 部门主键
     * @return 部门
     */
    @Override
    public SysDeptCderp selectSysDeptCderpByDeptId(Long deptId)
    {
        return sysDeptCderpMapper.selectSysDeptCderpByDeptId(deptId);
    }

    /**
     * 查询部门列表
     * 
     * @param sysDeptCderp 部门
     * @return 部门
     */
    @Override
    public List<SysDeptCderp> selectSysDeptCderpList(SysDeptCderp sysDeptCderp)
    {
        return sysDeptCderpMapper.selectSysDeptCderpList(sysDeptCderp);
    }

    /**
     * 新增部门
     * 
     * @param sysDeptCderp 部门
     * @return 结果
     */
    @Override
    public int insertSysDeptCderp(SysDeptCderp sysDeptCderp)
    {
        sysDeptCderp.setCreateTime(DateUtils.getNowDate());
        return sysDeptCderpMapper.insertSysDeptCderp(sysDeptCderp);
    }

    /**
     * 修改部门
     * 
     * @param sysDeptCderp 部门
     * @return 结果
     */
    @Override
    public int updateSysDeptCderp(SysDeptCderp sysDeptCderp)
    {
        sysDeptCderp.setUpdateTime(DateUtils.getNowDate());
        return sysDeptCderpMapper.updateSysDeptCderp(sysDeptCderp);
    }

    /**
     * 批量删除部门
     * 
     * @param deptIds 需要删除的部门主键
     * @return 结果
     */
    @Override
    public int deleteSysDeptCderpByDeptIds(Long[] deptIds)
    {
        return sysDeptCderpMapper.deleteSysDeptCderpByDeptIds(deptIds);
    }

    /**
     * 删除部门信息
     * 
     * @param deptId 部门主键
     * @return 结果
     */
    @Override
    public int deleteSysDeptCderpByDeptId(Long deptId)
    {
        return sysDeptCderpMapper.deleteSysDeptCderpByDeptId(deptId);
    }
}
